<?php

TestConfiguration::setup();

class TestConfiguration
{
	static $appRoot;

	static function setup()
	{
		// Set your Zend Framework library path(s) here - default is the master lib/ directory
		$zfRoot = realpath(dirname(basename(__FILE__)) . '/../../lib/');
		$appRoot = realpath(dirname((dirname(dirname(__FILE__)))));

		TestConfiguration::$appRoot = $appRoot;

		require_once 'PHPUnit/Framework.php';
		require_once 'PHPUnit/Framework/TestSuite.php';
		require_once 'PHPUnit/TextUI/TestRunner.php';

		error_reporting( E_ALL | E_STRICT );

		set_include_path($appRoot . '/application/models/'
		. PATH_SEPARATOR . $appRoot . '/library/'
		. PATH_SEPARATOR . $zfRoot
		. PATH_SEPARATOR . $zfRoot . '/incubator'
		. PATH_SEPARATOR . get_include_path());

		include 'Zend/Loader.php';
		Zend_Loader::registerAutoload();

		// load configuration
		$config = new Zend_Config_Ini($appRoot .'/application/configs/application.ini');
		Zend_Registry::set('config', $config);
var_dump($config);
		// set up database
		$db = Zend_Db::factory($config->db);
		Zend_Db_Table::setDefaultAdapter($db);
		Zend_Registry::set('db', $db);

	}

}
